package com.stu.vertx.hello.designPattern.prototype;

/**
 * clone方法的本质是克隆，在堆内存中开辟了新的内存空间
 */
public class Demo01_使用clone方法 {
    public static void main(String[] args) throws Exception {
        Resume r1 = new Resume("小明", 20, "本科", "3年");
        Resume r2 = r1.clone();
        Resume r3 = r1.clone();

        r1.show();
        r2.show();
        r3.show();

        System.out.println(r1 == r2);           // false
        System.out.println(r1 == r3);           // false
        System.out.println(r2 == r3);           // false
    }
}